!!!
%html
  %head{:lang => "zh-cmn-Hans"}
    %meta{:charset => "UTF-8"}/
    %meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
    %title 灰名单
    -#= stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    -#= javascript_include_tag 'application', 'data-turbolinks-track' => true
    
    %link{rel:"icon", href:"#{ufile_public_src_static('favicon.png')}", type:"image/x-icon"}
    %link{rel:"shortcut icon", href:"#{ufile_public_src_static('favicon.png')}", type:"image/x-icon"}

    
    = stylesheet_link_tag     '//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css'
    = stylesheet_link_tag     '//cdn.bootcss.com/font-awesome/4.4.0/css/font-awesome.min.css'
    
    -if Rails.env == 'development'
      = stylesheet_link_tag     'graylist.css'
    -if Rails.env == 'production'
      = stylesheet_link_tag   ufile_public_src_static("graylist.css")

    /[if lt IE 9]
      = javascript_include_tag      "//cdn.bootcss.com/html5shiv/r29/html5.min.js"
    = javascript_include_tag     '//cdn.bootcss.com/jquery/1.11.3/jquery.min.js'
    = javascript_include_tag     '//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js'
    = javascript_include_tag     '//cdn.bootcss.com/jquery-ujs/1.1.0/rails.min.js'
    -if Rails.env == 'development'
      = javascript_include_tag      "graylist.js"
    -if Rails.env == 'production'
      = javascript_include_tag      ufile_public_src_static("graylist.js")

    = csrf_meta_tags


  %body
    %header.user-header
      .container-fluid
        .row
          .col-md-6.col-sm-6.col-xs-6
            .header-left
              %a{href: "/"}
                = image_tag ufile_public_src_static('index_logo.png'), alt: '灰名单', title: '灰名单'
          .col-md-6.col-sm-6.col-xs-6
            .header-right
              %ul
                - if admin_signed_in?
                  %li.sign-in
                    = link_to '管理员['+current_admin.username+']', '#'
                  %li.sign-up
                    %a{href:"#{destroy_admin_session_path}", "data-method"=>"delete"}
                      %i.glyphicon.glyphicon-off
                      注销
                - if user_signed_in?
                  %li.sign-in
                    = link_to '用户['+current_user.mobile+']', '#'
                  %li.sign-up
                    %a{href:"#{destroy_user_session_path}", "data-method"=>"delete"}
                      %i.glyphicon.glyphicon-off
                      注销
                    =# link_to '注销', destroy_user_session_path, :method => :delete
                -# else
                  %li.sign-in
                    %span.glyphicon.glyphicon-user{"aria-hidden" => "true"}
                    = link_to '登录', new_admin_session_path
                  %li.sign-up
                    %span.glyphicon.glyphicon-pencil{"aria-hidden" => "true"}
                    = link_to '注册', new_admin_registration_path
    .yc-admin-left
      .panel-group#accordion{role: "tablist", "aria-multiselectable": "true"}
        - if admin_signed_in?
          -#%li.btn.btn-primary{class: nav_active(controller: 'credit_records')}
          .panel.panel-default
            .panel-heading#headingOne{role: "tab"}
              %h4.panel-title
                %i.glyphicon.glyphicon-th-list
                灰名单管理
            #collapseOne.panel-collapse.collapse.in{class: nav_active(controller: 'credit_records'), role: "tabpanel", "aria-labelledby": "headingOne"}
              .panel-body
                = link_to '全部', credit_records_path
                .badge.badge-primary
                  = CreditRecord.count
                %br/
                = link_to '等待审核', credit_records_path(state: 'new')
                .badge.badge-danger
                  = CreditRecord.with_new_state.count
                %br/
                = link_to '审核成功', credit_records_path(state: 'approved')
                .badge
                  = CreditRecord.with_approved_state.count
                %br/
                = link_to '审核失败', credit_records_path(state: 'rejected')
                .badge
                  = CreditRecord.with_rejected_state.count
                %br/
          -#%li{class: nav_active(controller: 'articles')}=link_to '文章管理', articles_path
          .panel.panel-default
            .panel-heading#headingTwo{role: "tab"}
              %h4.panel-title
                %i.glyphicon.glyphicon-text-size
                文章管理
            #collapseTwo.panel-collapse.collapse.in{class: nav_active(controller: 'articles'), role: "tabpanel", "aria-labelledby": "headingTwo"}
              .panel-body
                =link_to '文章管理', articles_path
                %br
                =link_to '文章图片管理', images_path
          -#%li{class: nav_active(controller: 'users')}=link_to '会员管理', users_path
          .panel.panel-default
            .panel-heading#headingThree{role: "tab"}
              %h4.panel-title
                %i.glyphicon.glyphicon-user
                会员管理
            #collapseThree.panel-collapse.collapse.in{class: nav_active(controller: 'users'), role: "tabpanel", "aria-labelledby": "headingThree"}
              .panel-body
                = link_to '全部会员', users_path
                .badge.badge-primary
                  = User.count
                %br/
                = link_to '未认证会员', users_path(state: 'new')
                .badge
                  = User.with_new_state.count
                %br/
                = link_to '待认证会员', users_path(state: 'awaiting_certification')
                .badge.badge-danger
                  = User.with_awaiting_certification_state.count
                %br/
                = link_to '个人认证会员', users_path(state: 'certified_individual')
                .badge
                  = User.with_certified_individual_state.count
                %br/
                = link_to '公司认证会员', users_path(state: 'certified_company')
                .badge
                  = User.with_certified_company_state.count
          -#%li{class: nav_active(controller: 'configs', action: 'about_us')}=link_to '设置关于我们', about_us_path
          .panel.panel-default
            .panel-heading
              %h4.panel-title
                %i.glyphicon.glyphicon-wrench
                设置
          .panel-collapse.collapse.in
            .panel-body
              %a{href:"#{about_us_path}"}
                %i.glyphicon.glyphicon-cog
                关于我们
              %br/
              %a{href:"#{service_term_path}"}
                %i.glyphicon.glyphicon-cog
                服务条款
              %br/
              %a{href:"#{contact_us_path}"}
                %i.glyphicon.glyphicon-cog
                联系我们
              %br/
              %a{href:"#{mobile_download_qr_path}"}
                %i.glyphicon.glyphicon-cog
                手机下载二维码
              %br/
              %a{href:"#{weixin_qr_path}"}
                %i.glyphicon.glyphicon-cog
                微信二维码
              %br/
              %a{href:"#{login_ad_path}"}
                %i.glyphicon.glyphicon-cog
                登录界面广告图片
              %br/
              %a{href:"#{admin_change_password_path}"}
                %i.glyphicon.glyphicon-cog
                修改密码
              %br/
        -elsif user_signed_in?
          .panel.panel-default
            .panel-heading
              %h4.panel-title
                -#{class: nav_active(controller: 'credit_records')}
                =link_to '我的灰名单', credit_records_path
          .panel.panel-default
            .panel-heading
              %h4.panel-title
                -#{class: nav_active(controller: 'manage')}
                =link_to '账号信息', user_profile_path
          -#
            .panel.panel-default
              .panel-heading
                %h4.panel-title
                  -#{class: nav_active(controller: 'cars')}
                  =link_to '车辆管理', cars_path
            .panel.panel-default
              .panel-heading
                %h4.panel-title
                  -#{class: nav_active(controller: 'traffic_violations')}
                  =link_to '违章信息', traffic_violations_path
    .yc-admin-right
      = yield
